# docker build -t tannnn/pdap:0.1 .
# docker run -d -p 9003:9003  --name pdap -v /home/java/logs:/logs -e ACTIVE="prod" tannnn/pdap:0.1
# docker run -d -p 9003:9003 --name pdap  -v D:\docker\docker-file\贵州中医药\java:/logs -e ACTIVE="prod" tannnn/pdap:0.1
# 基础镜像使用java
# FROM java:8
# https://hub.docker.com/_/openjdk?tab=tags&page=1&ordering=last_updated&name=8
FROM openjdk:8u312-slim-buster
# 作者
MAINTAINER tan


#定义时区参数
ENV TZ=Asia/Shanghai

#设置时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone


VOLUME /tmp
# 将jar 包添加到容器中并更名
ADD ./target/file-server.jar /app.jar
ADD ./target/classes/script/docekrfile_start.sh start.sh
RUN chmod +x /start.sh

# 暴露端口
EXPOSE 9001

ENV PARAMS=""


#    environment:
#      # TODO 根据自己的配置修改，配置项参考源码文件：/resources/application-prod.properties
#      PARAMS: "--spring.datasource.url=jdbc:mysql://mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&useSSL=false
#               --spring.datasource.username=root
#               --spring.datasource.password=file
#               --server.servlet.context-path=/job
#               --spring.mail.host=smtp.qq.com
#               --spring.mail.port=25
#               --spring.mail.username=3316459837@qq.com

ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /app.jar $PARAMS"]

# CMD /bin/bash

